Open
Conversation
A table `vibetype.invitation` was added that inherits from table `notification`which was moved from schema `maevsi_private` to schema `maevsi`. In orrder to make functions that were originally created in `test_account_blocking.sql` generally available for all tests (including tests for invitations), these functions were moved to `function_test_utilities.sql`.
dargmuesli
reviewed
Mar 25, 2025
Closed
dargmuesli
reviewed
Mar 25, 2025
dargmuesli
reviewed
Mar 25, 2025
In `function_test_utilities.sql' many functions set the role back to the session user at their end. We use `SET LOCAL ROLE NONE`to be independent of any real user name.
Switching back to the login role can be done with ` SET LOCAL ROLE NONE`.
Table `invitation` has been renamed to `notification_invitation`.
The functions `vibetype_test.account_create` and `vibetype_test.contact_create` must run in mode SECURITY DEFINER in order to work when not logged in as the owner of the database objects.
Column `created_by` was moved from table `notification_invitation` to table `notification`. Row level security was added to table `notification`. Some modifications were made to functions in `function_test_utilities.sql`.
The policies for tables `notification` and `notification_invitation` were updated to make use of `FOR ALL` policies.
dargmuesli
reviewed
Apr 25, 2025
04185ea to
4096079
Compare
For tables `vibetype.notification` and `vibetype.notification_invitation` the policies were moved to the table files, making the policy files obsolete.
4096079 to
9bdd042
Compare
c988911 to
9949a49
Compare
dargmuesli
reviewed
May 2, 2025
Comment on lines
+17
to
+20
| CREATE POLICY notification_invitation_all ON vibetype.notification_invitation FOR ALL | ||
| USING ( | ||
| created_by = vibetype.invoker_account_id() | ||
| ); |
Member
There was a problem hiding this comment.
Isn't this covered by the parent table?
Contributor
Author
There was a problem hiding this comment.
yes, see Postgreqsl documentation, section 5.11: "In a similar way, the parent table's row security policies (see Section 5.9) are applied to rows coming from child tables during an inherited query. A child table's policies, if any, are applied only when it is the table explicitly named in the query; and in that case, any policies attached to its parent(s) are ignored."
The function `invite` has been changed to only store the event id in the payload of the notification record.
The policy for table `notification_invitation` has been removed because it is already present for the parent table `notification`.
dargmuesli
reviewed
May 6, 2025
Function `invite`has been restored to its previous implementation regarding JSON payload.
e341cdc to
4981600
Compare
6a33bb5 to
60d363d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A table
vibetype.invitationwas added that inherits from tablenotificationwhich was moved from schemamaevsi_privateto schemamaevsi. In orrder to make functions that were originally created intest_account_blocking.sqlgenerally available for all tests (including tests for invitations), these functions were moved tofunction_test_utilities.sql.